package org.scboy.logger.service.imp;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

import org.scboy.coobi.sql.factory.EntityFactory;
import org.scboy.logger.dao.LoggerDbTableLogDao;
import org.scboy.logger.service.LoggerDbTableLogService;
import org.scboy.utils.entitys.coobi.Model;
import org.scboy.utils.entitys.coobi.Page;

/**
 * 
 * 数据库表数据表更日志
 * @author 杨浩
 *
 */
@Service
public class LoggerDbTableLogServiceImpl implements LoggerDbTableLogService {
	
	@Autowired
	EntityFactory factory;
	
	 /**
	  * 分页查询数据库表数据表更日志。
	  * @param params 查询参数
	  * @return
	  */	
	@Override
	public Page page(Model params) {
		LoggerDbTableLogDao dao=factory.getDao(LoggerDbTableLogDao.class);
		params.orderBy("logTime").addNrc("headData").addNrc("exeSql").addNrc("exeParams");
		return dao.page(params);
	}
    
   /**
	 * 获取数据库表数据表更日志详细信息。
	 * @param 查询条件
	 * @return
	 */
	@Override
	public Model get(Model params) {
		LoggerDbTableLogDao dao=factory.getDao(LoggerDbTableLogDao.class);
		return dao.get(params);
	}

@Override
public List<Model> list(Model params) {
	LoggerDbTableLogDao dao=factory.getDao(LoggerDbTableLogDao.class);
	params.orderBy("logTime").addNrc("headData").addNrc("exeSql").addNrc("exeParams");
	return dao.select(params);
}
    
}
